package apig.servlet.access.policy;

import apig.client.serviface.*;
import apig.servlet.access.*;

public class ProfAndOwnerIdAccessPolicy implements
		PermissionPolicy<UserIdRD> {

	@Override
	public boolean isPermissionGranted(UserData ud, UserIdRD rd) {
		if (ud.role == UserData.ROLE_PROF
				|| (ud.role == UserData.ROLE_STUD && ud.userId == rd
						.getUserId())) {
			return true;
		} else {
			return false;
		}
	}
}
